package com.boot.security.server.user.service;

import com.boot.security.server.dto.UserDto;
import com.boot.security.server.page.table.PageTableRequest;
import com.boot.security.server.page.table.PageTableResponse;
import com.boot.security.server.user.model.SysUsers;

import java.util.List;

/**
 * @author king
 */
public interface UserService {
    /**
     * 新增
     * @param userDto
     * @return
     */
    SysUsers saveUser (UserDto userDto);

    /**
     * 修改
     * @param userDto
     * @return
     */
    SysUsers updateUser (UserDto userDto);

    /**
     * 获取
     * @param username
     * @return
     */
    SysUsers getUser (String username);
    SysUsers getUserByOa (String username);

    /**
     * 修改密码
     * @param username
     * @param oldPassword
     * @param newPassword
     */
    void changePassword (String username, String oldPassword, String newPassword);

    /**
     * 启用/禁用
     * @param id
     */
    SysUsers enDis (Long id);

    /**
     * 列表查询
     * @param request
     * @return
     */
    PageTableResponse listUsers (PageTableRequest request);

    /**
     * 根据用户id查询用户
     * @param id
     * @return
     */
    SysUsers getById(Long id);

    /**
     * 根据用户下级id
     *
     * @param id
     * @return
     */
    List<SysUsers> getByPid(Integer userId);

    String getUserName(String oversee);
}
